package com.anyou.mall.pla.service.impl;

import java.util.List;
import com.anyou.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.anyou.mall.pla.mapper.HotSearchMapper;
import com.anyou.mall.pla.domain.HotSearch;
import com.anyou.mall.pla.service.IHotSearchService;

/**
 * 热门搜索关键词Service业务层处理
 * 
 * @author gaochaohao
 * @date 2022-03-21
 */
@Service
public class HotSearchServiceImpl implements IHotSearchService 
{
    @Autowired
    private HotSearchMapper hotSearchMapper;

    /**
     * 查询热门搜索关键词
     * 
     * @param searchId 热门搜索关键词主键
     * @return 热门搜索关键词
     */
    @Override
    public HotSearch selectHotSearchBySearchId(Long searchId)
    {
        return hotSearchMapper.selectHotSearchBySearchId(searchId);
    }

    /**
     * 查询热门搜索关键词列表
     * 
     * @param hotSearch 热门搜索关键词
     * @return 热门搜索关键词
     */
    @Override
    public List<HotSearch> selectHotSearchList(HotSearch hotSearch)
    {
        return hotSearchMapper.selectHotSearchList(hotSearch);
    }

    /**
     * 新增热门搜索关键词
     * 
     * @param hotSearch 热门搜索关键词
     * @return 结果
     */
    @Override
    public int insertHotSearch(HotSearch hotSearch)
    {
        hotSearch.setCreateTime(DateUtils.getNowDate());
        return hotSearchMapper.insertHotSearch(hotSearch);
    }

    /**
     * 修改热门搜索关键词
     * 
     * @param hotSearch 热门搜索关键词
     * @return 结果
     */
    @Override
    public int updateHotSearch(HotSearch hotSearch)
    {
        hotSearch.setUpdateTime(DateUtils.getNowDate());
        return hotSearchMapper.updateHotSearch(hotSearch);
    }

    /**
     * 批量删除热门搜索关键词
     * 
     * @param searchIds 需要删除的热门搜索关键词主键
     * @return 结果
     */
    @Override
    public int deleteHotSearchBySearchIds(Long[] searchIds)
    {
        return hotSearchMapper.deleteHotSearchBySearchIds(searchIds);
    }

    /**
     * 删除热门搜索关键词信息
     * 
     * @param searchId 热门搜索关键词主键
     * @return 结果
     */
    @Override
    public int deleteHotSearchBySearchId(Long searchId)
    {
        return hotSearchMapper.deleteHotSearchBySearchId(searchId);
    }
}
